package com.webank.wedatasphere.linkis.config;


import com.webank.wedatasphere.linkis.server.restful.RestfulApplication;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.servlet.ServletContainer;
import org.glassfish.jersey.servlet.ServletProperties;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class JerseyConfig extends ResourceConfig {

    @Bean
    public ServletRegistrationBean jerseyServlet() {
        //手动注册servlet
        ServletRegistrationBean registrationBean = new ServletRegistrationBean(new ServletContainer(), "/*");
        registrationBean.addInitParameter(ServletProperties.JAXRS_APPLICATION_CLASS, RestfulApplication.class.getName());

        return registrationBean;
    }

}
